<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/** Client Page **/
class Client extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model("clients");
	}
	
	public function index()
	{
		$value['title']  = "Client";
		$value['clients']= $this->clients->getAllRecords();
		$value['content']= "vclient/v-index-client";
		$this->load->view('themes/bdo/index',$value);
	}
	
	public function add_new()
	{
		$value['title']  = "Client";
		$value['content']= "vclient/v-add-client";
		$this->load->view('themes/bdo/index',$value);
	}
	
	public function save(){
		if($this->input->post('name'))
			$this->clients->saveClient();
		redirect('client/index');	
	}
	
	public function edit($id)
	{
		$value['title']  = "Client";
		$value['client'] = $this->clients->getDataSingleRecord($id);
		$value['content']= "vclient/v-edit-client";
		$this->load->view('themes/bdo/index',$value);
	}
	
	public function update(){
		if($this->input->post('name'))
			$this->clients->updateClient();
		redirect('client/index');	
	}
	
	public function remove($id){
		$this->clients->removeClient($id);
		redirect($this->input->server('HTTP_REFERER'),301);
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/client.php */